home *** CD-ROM | disk | FTP | other *** search
- /*
- * Copyright 1990, 1991, 1992, 1993, 1994, Silicon Graphics, Inc.
- * All Rights Reserved.
- *
- * This is UNPUBLISHED PROPRIETARY SOURCE CODE of Silicon Graphics, Inc.;
- * the contents of this file may not be disclosed to third parties, copied or
- * duplicated in any form, in whole or in part, without the prior written
- * permission of Silicon Graphics, Inc.
- *
- * RESTRICTED RIGHTS LEGEND:
- * Use, duplication or disclosure by the Government is subject to restrictions
- * as set forth in subdivision (c)(1)(ii) of the Rights in Technical Data
- * and Computer Software clause at DFARS 252.227-7013, and/or in similar or
- * successor clauses in the FAR, DOD or NASA FAR Supplement. Unpublished -
- * rights reserved under the Copyright Laws of the United States.
- */
-
- #ifndef __SHOWCASEUI_H__
- #define __SHOWCASEUI_H__
-
- #ifdef __cplusplus
- extern "C" {
- #endif
-
- #define UILEFT 100
- #define UIRIGHT 101
- #define UILRCENTER 102
- #define UITBCENTER 103
- #define UITOP 104
- #define UIBOTTOM 105
-
- #define UIBUTTONUP 0
- #define UIBUTTONDOWN 1
- #define UIBUTTONCLICK 2
- #define UIBUTTONDOUBLE 3
-
- #define P_UISHADOW 343
- #define P_UILINESHADOW 344
-
- #define MENUBARHEIGHT 26
- #define SHADOWOFFSET 6
- #define MENUXGAP 9
-
- #define TEXTHEIGHT 20
- #define DEFAULTFONT 0
-
- #define CHECKBUTTON 1
- #define PALETTEBUTTON 2
- #define PUSHBUTTON 3
- #define RADIOBUTTON 4
- #define TOGGLEBUTTON 5
- #define TINYTOGGLE 6
- #define ICONBUTTON 7
- #define ICON 8
- #define INDICATOR 9
- #define BED 10
- #define GENERICBUTTON 11
- #define PTRBUTTON 12
- #define CUSTOMBUTTON 13
- #define TINYRADIO 14
- #define VSLIDER 15
- #define HSLIDER 16
- #define VALUATOR 17
- #define TEXTBOX 18
- #define TEXTLIST 19
- #define MENUBAR 20
- #define PULLDOWNMENU 21
- #define POPUPMENU 22
- #define TEXTLABEL 23
- #define BOLDTEXTLABEL 24
-
- #define TROUGH 3
- #define THUMB 2
- #define SCROLLDOWN -1
- #define SCROLLUP 1
- #define SLIDERWIDTH 20
- #define ARROWHEIGHT 20
- #define MINSHALF 13
-
- /* Buttons */
-
- #define BUTSTRLEN 200
- #define BUTHEIGHT 28
- #define BUTWIDTH 75
- #define TINYTOGGLEHEIGHT 16
- #define TINYTOGGLEWIDTH 16
- #define TINYRADIOHEIGHT 16
- #define TINYRADIOWIDTH 16
- #define PALETTEHEIGHT 35
- #define PALETTEWIDTH 40
- #define ICONHEIGHT 32
- #define ICONWIDTH 32
- #define CHECKHEIGHT 20
- #define CHECKWIDTH 20
- #define RADIOHEIGHT 24
- #define RADIOWIDTH 24
- #define INDICATORHEIGHT 28
- #define INDICATORWIDTH 10
- #define LABELFONTHEIGHT 11
-
- #define BUTTONICONFONT 5600
- #define BUTTONFONT1 5601
- #define BUTTONFONT2 5602
- #define BUTTONFONT3 5603
-
- typedef struct AButton {
- long xmin,xmax,ymin,ymax;
- long number; /* the button number--used internally */
- char str[BUTSTRLEN+1]; /* the label on or next to the button */
- short active; /* the button is on (menu option label #) */
- short enable; /* the button is able to be pressed */
- short locate; /* the button is locate highlighted */
- short select; /* the button is pressed */
- short invisible; /* the button is not visible */
- short type; /* checkbutton, indicator, etc. */
- short thedefault; /* the button is the default button */
- short sticky; /* stays pressed until an unpress is called */
- void (*butcolor)(); /* color of the text or icon on the button */
- void (*drawbutton)(); /* color of the text or icon on the button */
- struct AButton **links; /* used mainly for radio buttons to connect */
- long numlinks; /* the number of button links */
- } Button;
-
- Button *newbut(long, long, long, long);
- Button *newcheckbut(long, long);
- Button *newpushbut(long, long);
- Button *newtogglebut(long, long, long);
- Button *newradiobut(long, long);
- Button *newindicator(long, long);
- Button *newtinyradio(long, long);
- Button *newtinytoggle(long, long);
- Button *newpalettebut(long, long);
- Button *newiconbut(long, long);
- Button *newptrbut(long, long);
- Button *newicon(long, long);
- Button *newcustombut(long, long, long, long, void (*drawbutton)());
- Button *newbed(long, long, long, long);
- Button *handlebutchar(long);
-
- void drawcheckbut(Button *b);
- void drawindicatorbut(Button *b);
- void drawpushbut(Button *b);
- void drawbed(Button *b);
- void drawtogglebut(Button *b);
- void drawradiobut(Button *b);
- void drawindicator(Button *b);
- void drawtinyradio(Button *b);
- void drawtinytoggle(Button *b);
- void drawpalettebut(Button *b);
- void drawiconbut(Button *b);
- void drawicon(Button *b);
- void drawptrbut(Button *b);
-
- void freebut(Button *);
- void activatebut(Button *);
- void deactivatebut(Button *);
- void lockbut(Button *);
- void flipactive(Button *);
- void highlightbut(Button *);
- void unhighlightbut(Button *);
- void defaultbut(Button *);
- void undefaultbut(Button *);
- void setcolorbut(Button *, void (*butcolor)());
- void linkbuttons(Button *, Button *);
- void unlinkbutton(Button *);
- void disablebut(Button *);
- void enablebut(Button *);
- void selectbut(Button *);
- void unselectbut(Button *);
- void makevisiblebut(Button *);
- void makeinvisiblebut(Button *);
- void stickbut(Button *);
- void unstickbut(Button *);
- void loadbut(Button *, char *);
- void unpressbut(Button *);
- void initbut();
- void initiconbut();
- void drawbut(Button *);
- void drawbutnow(Button *);
- void drawborder(Button *);
- void drawaborder(long, long, long, long);
- void positionbut(Button *, short, long);
- void drawlabel(char *, long, long);
- void drawboldlabel(char *, long, long);
- void clearlabel(char *, long, long);
- void drawiconlabel(Button *);
- void unpresslinkbuts(Button *);
- void UIdrawbuttons();
- void UIlocatebuttons();
-
- short gethighlightbut(Button *);
- short getdefaultbut(Button *);
- short locatebut(Button *, long, long);
- short valuebut(Button *);
- short getenablebut(Button *);
- short getselectbut(Button *);
- short getvisiblebut(Button *);
- short getstickbut(Button *);
- short inbut(Button *, long, long);
- short pressbut(Button *, long, long);
- short selectedpressbut(Button *, long, long, long);
-
- /* Horizontal Sliders */
-
- typedef struct {
- long xmin, ymin, xmax, ymax;
- long scenter; /* the center of the thumb */
- long shalf; /* half of the thumb length */
- long oldpos; /* old scenter */
- long arrowdelta; /* arrow delta */
- short locate; /* locate highlight */
- short select; /* selected or not */
- short invisible; /* the slider is not visible */
- short enable; /* the slider is enabled */
- short thumb; /* whether the thumb should show */
- } Slider;
-
- typedef Slider HSlider;
-
- HSlider *newhs(long, long, long, long, long);
-
- void movehs(HSlider *, long, long, long);
- void setarrowdeltahs(HSlider *, long);
- void freehs(HSlider *);
- void disablehs(HSlider *);
- void enablehs(HSlider *);
- void highlighths(HSlider *, short);
- void unhighlighths(HSlider *);
- void selecths(HSlider *, short);
- void unselecths(HSlider *);
- void makevisiblehs(HSlider *);
- void makeinvisiblehs(HSlider *);
- void presshsarrow(HSlider *, short);
- void sethshalf(HSlider *, long);
- void sethscenter(HSlider *, long);
- void sethsval(HSlider *, float);
- void movehsval(HSlider *, float);
- void reseths(HSlider *);
- void drawhs(HSlider *);
- void drawhsnow(HSlider *);
- void drawhsarrows(HSlider *);
-
- short locatehs(HSlider *, long, long);
- short getenablehs(HSlider *);
- short gethighlighths(HSlider *);
- short getselecths(HSlider *);
- short getenablehs(HSlider *);
- short getvisiblehs(HSlider *);
- short inhs(HSlider *, long, long);
- short handlehs(HSlider *, long, long);
-
- short selectedhs(HSlider *, long, long, long, long *, void (*adjust)());
-
- long gethstrough(HSlider *);
-
- float gethsval(HSlider *);
-
- /* Pull-down menus and MenuBars */
-
- typedef int (*PFI)();
-
- typedef struct MenuItem {
- struct MenuItem *next; /* next entry in pulldown */
- PFI func; /* executed by entry chosen %f */
- PFI itemfunc;
- PFI draw; /* custom drawing on entry %d */
- struct PullDown *pd; /* pulldown for rollover menu %m*/
- char *text; /* text in entry */
- short width; /* required width for this entry*/
- short yoffset; /* offset from pd->yorg */
- short select; /* selected or not */
- short no; /* number of entry */
- long retno; /* return value %x */
- short underline; /* separator under this entry %l*/
- short active; /* check mark or not */
- short enable; /* able to be picked */
- char *altkey; /* alt key equivalent %a */
- } MenuItem;
-
- typedef struct PullDown {
- struct MenuItem *entries; /* menu entries on pulldown */
- struct PullDown *subpd;
- PFI func; /* exec. by any choice on pd %F */
- short nentries; /* number of menu entries on pd */
- short slide; /* any entries have a rollover? */
- short active; /* any entries have a check mark*/
- short width; /* max. width of all entries */
- short height; /* height of pulldown */
- char *title; /* title on menubar & pulldown */
- short twidth; /* pixel width of title */
- short xorg; /* screen coordinates of right */
- short yorg; /* screen coordinates of top */
- short txorg; /* screen coords. of title xorg */
- short orglocked;
- short enable; /* able to be picked */
- struct menubar *mb; /* the menu bar where this pd is*/
- } PullDown;
-
- typedef struct menubar {
- long xorg, yorg; /* origin of window */
- long xmin, ymin, xmax, ymax; /* screen coordinates */
- long count; /* number of pulldown menus */
- short locate; /* locate highlight (# of pd) */
- short invisible; /* the menu bar is not visible */
- short enable; /* the menu bar is enables */
- PullDown **pds; /* pulldown menus */
- } MenuBar;
-
- PullDown *newpd(MenuBar *, char *);
- PullDown *createmenu(MenuBar *, char **, long, long);
-
- void freepd(register PullDown *);
- void initpd();
- #ifdef __cplusplus
- void loadpd(...);
- #else
- void loadpd();
- #endif
- void deactivatepdentry(PullDown *, char *);
- void activatepdentry(PullDown *, char *);
- void disablepdentry(PullDown *, char *);
- void enablepdentry(PullDown *, char *);
- void disablepd(PullDown *);
- void enablepd(PullDown *);
- void changepdtitle(PullDown *, char *);
- void addtopd(PullDown *, MenuItem *);
-
- short getenablepd(PullDown *);
- short changepd(PullDown *, char *, char *);
- short valuepdentry(PullDown *, char *);
-
- MenuItem *getpdentry(PullDown *, char *);
- MenuBar *newmenubar();
-
- void loadmenubar(MenuBar *, long, PullDown **);
- void addtomenubar(MenuBar *, PullDown *);
- void removefrommenubar(MenuBar *, PullDown *);
- void movemenubar(MenuBar *);
- void highlightmb(MenuBar *, long);
- void unhighlightmb(MenuBar *);
- void makevisiblemb(MenuBar *);
- void makeinvisiblemb(MenuBar *);
- void enablemb(MenuBar *);
- void disablemb(MenuBar *);
- void drawmenubar(MenuBar *);
- void drawmenubarnow(MenuBar *);
-
- long dopulldown(MenuBar *);
- long inmenubar(MenuBar *, long, long);
-
- short gethighlightmb(MenuBar *);
- short getvisiblemb(MenuBar *);
- short getenablemb(MenuBar *);
- short locatemenubar(MenuBar *, long, long);
-
- /* Text Boxes */
-
- #define LABELSTRLEN 50
- #define TBSTRLEN 200
- #define TEXTBOXHEIGHT 28
-
- /* Define for the settbtype() and gettypein() flag */
- #define TYPEIN_STRING 0
- #define TYPEIN_INT 1
- #define TYPEIN_FILE 2
- #define TYPEIN_FLOAT 3
- #define TYPEIN_HEX 4
- #define TYPEIN_WHOLE 5
-
- typedef struct {
- long xmin, xmax, ymin;
- long number; /* the tb number--used internally */
- char str[TBSTRLEN+1]; /* contents of text box */
- char label[LABELSTRLEN+1]; /* label to left of text box */
- long tp1, tp2; /* textpointers */
- long charWidth; /* width of box in # of characters */
- short active;
- short enable;
- short invisible; /* the text box is not visible */
- short type; /* for type-checking */
- long index; /* index into leftmost visible character */
- } TextBox;
-
- TextBox *newtb(long, long, long);
- TextBox *getactivetb();
-
- void inittb();
- void freetb(TextBox *);
- void labeltb(TextBox *, char *);
- void settbtype(TextBox *, long);
- void movetb(TextBox *, long, long, long);
- void activatetb(TextBox *);
- void deactivatetb(TextBox *);
- void enabletb(TextBox *);
- void disabletb(TextBox *);
- void makevisibletb(TextBox *);
- void makeinvisibletb(TextBox *);
- void cleartb(TextBox *);
- void adjusttb(TextBox *, long);
- void loadtb(TextBox *, char *);
- void backspacetb(TextBox *);
- void inserttbchar(TextBox *, char);
- void drawtb(TextBox *);
- void drawtbnow(TextBox *);
-
- char *gettbstr(TextBox *);
-
- short intb(TextBox *, long, long);
- short handletb(TextBox *, long, long, long, long);
- short findtp(TextBox *, long);
- short getenabletb(TextBox *);
- short getvisibletb(TextBox *);
-
- int tilde(char *, char *);
-
- /* Vertical Sliders */
-
- typedef Slider VSlider;
-
- VSlider *newvs(long, long, long, long, long);
-
- void movevs(VSlider *, long, long, long);
- void setarrowdelta(VSlider *, long);
- void freevs(VSlider *);
- void disablevs(VSlider *);
- void enablevs(VSlider *);
- void highlightvs(VSlider *, short);
- void unhighlightvs(VSlider *);
- void selectvs(VSlider *, short);
- void unselectvs(VSlider *);
- void makevisiblevs(VSlider *);
- void makeinvisiblevs(VSlider *);
- void pressvsarrow(VSlider *, short);
- void setvshalf(VSlider *, long);
- void setvscenter(VSlider *, long);
- void setvsval(VSlider *, float);
- void movevsval(VSlider *, float);
- void resetvs(VSlider *);
- void drawvs(VSlider *);
- void drawvsnow(VSlider *);
- void drawvsarrows(VSlider *);
-
- short locatevs(VSlider *, long, long);
- short getenablevs(VSlider *);
- short gethighlightvs(VSlider *);
- short getselectvs(VSlider *);
- short getenablevs(VSlider *);
- short getvisiblevs(VSlider *);
- short invs(VSlider *, long, long);
- short handlevs(VSlider *, long, long);
-
-
- long getvstrough(VSlider *);
-
- float getvsval(VSlider *);
-
- /* Text Lists */
-
- #define TEXTLISTFONT 5601
-
- typedef struct {
- long xmin, xmax, ymin, ymax;
- long listheight; /* in lines of text */
- char **strs; /* text */
- long top; /* index into strs */
- long count; /* total number of strings */
- long selecteditem; /* index into selecteditem or -1 */
- long locateditem; /* index into locateditem or -1 */
- short invisible; /* the text list is not visible */
- VSlider *vs; /* the associated slider if one */
- } TextList;
-
- short selectedvs(VSlider *, TextList *, long, long, long);
-
- TextList *newtl(long, long, long, long);
-
- void movetl(TextList *, long, long, long, long);
- void inittl();
- void resettl(TextList *);
- void unselecttl(TextList *);
- void selecttlitem(TextList *, long);
- void highlighttl(TextList *, long);
- void unhighlighttl(TextList *);
- void makevisibletl(TextList *);
- void makeinvisibletl(TextList *);
- void settltop(TextList *, long);
- void settlstrings(TextList *, char **);
- void adjusttop(TextList *, float);
- void drawtl(TextList *);
- void drawtlnow(TextList *);
- void settlstrslinkhandle(char **, TextList *);
- void adjustslider(TextList *, VSlider *);
-
- short getselectedtlitem(TextList *);
- short gethighlighttl(TextList *);
- short getvisibletl(TextList *);
- short getitemvisibletl(TextList *, long);
- short locatetl(TextList *, long, long);
- short intl(TextList *, long, long);
- short handletl(TextList *, long, long);
- short selectedtl(TextList *, long, long, long);
-
- long gettextlistheight(long);
- long gettlheightcount(long, long);
-
- char *selectedstring(TextList *);
-
- /* Valuators */
-
- #define VALUATORWIDTH 22
-
- typedef Slider Valuator;
-
- Valuator *newval(long, long, long, long, long, short);
-
- void moveval(Valuator *, long, long, long);
- void setvalarrowdelta(Valuator *, long);
- void freeval(Valuator *);
- void disableval(Valuator *);
- void enableval(Valuator *);
- void highlightval(Valuator *, short);
- void unhighlightval(Valuator *);
- void selectval(Valuator *, short);
- void unselectval(Valuator *);
- void makevisibleval(Valuator *);
- void makeinvisibleval(Valuator *);
- void pressvalarrow(Valuator *, short);
- void setvalhalf(Valuator *, long);
- void setvalcenter(Valuator *, long);
- void setvalval(Valuator *, float);
- void movevalval(Valuator *, float);
- void resetval(Valuator *);
- void drawval(Valuator *);
- void drawvalnow(Valuator *);
- void drawvalarrows(Valuator *);
-
- short getarrowsval(Valuator *);
- short getenableval(Valuator *);
- short gethighlightval(Valuator *);
- short getselectval(Valuator *);
- short getvisibleval(Valuator *);
- short locateval(Valuator *, long, long);
- short inval(Valuator *, long, long);
- short handleval(Valuator *, long, long);
- short selectedval(Valuator *, long, long, long);
-
- float getvalval(Valuator *);
-
- /* Misc. */
- void backgrounddraw(long, long, long, long);
- void backgroundclear();
- void windowborderdraw();
- void initui();
- void uiokdraw();
- void uinodraw();
- void defglfont(char *, long, long);
- void unlocateall();
-
- short uiswapbuffers();
-
- void uiWhite();
- void uiVyLtGray();
- void uiBlack();
-
- #ifdef NOTDEF
- typedef struct {
- short type;
- short active;
- short enable;
- short invisible;
- short select; /* selected or not */
- long xmin, ymin, xmax, ymax;
- widget_t *(*createme)();
- void (*deleteme)();
- void (*drawme)();
- long (*editme)();
- void (*inme)();
- void (*loadme)();
- short (*locateme)();
- void (*positionme)();
- } Widget;
- #endif
- #ifdef __cplusplus
- }
- #endif
-
- #endif /* !__SHOWCASEUI_H__ */
-